#ifndef _PacketScene_h__
#define _PacketScene_h__

#include "Global.h"
#include "../EquipItem.h"
#include "../ListItem.h"

enum PackTab
{
	PACK_TAB_EQUIP = 0,
	PACK_TAB_PACKET,
	PACK_TAB_SELL
};

class PacketScene
	: public State
	, public cocos2d::extension::CCBMemberVariableAssigner
	, public cocos2d::extension::CCBSelectorResolver
	, public cocos2d::extension::CCNodeLoaderListener
{
public:
	CCB_STATIC_NEW_AUTORELEASE_OBJECT_WITH_INIT_METHOD(PacketScene, create);

	PacketScene(void);
	~PacketScene(void);

	virtual SEL_MenuHandler onResolveCCBCCMenuItemSelector(CCObject * pTarget, CCString * pSelectorName);
	virtual SEL_CCControlHandler onResolveCCBCCControlSelector(CCObject * pTarget, CCString * pSelectorName);
	virtual bool onAssignCCBMemberVariable(CCObject * pTarget, CCString * pMemberVariableName, CCNode * pNode);
	virtual void onNodeLoaded(CCNode * pNode, CCNodeLoader * pNodeLoader);
	bool init();
	void refresh();
	void onEnter();
	void onExit();
	static PackTab msCurTab;
private:
	//CCLabelTTF* mName;
	CCScrollView* mScrollView;
	vector<ListItem*> mCurList;
	void onEquipTabClick(CCObject * pSender, CCControlEvent pCCControlEvent);
	void onPacketTabClick(CCObject * pSender, CCControlEvent pCCControlEvent);
	void onSellTabClick(CCObject * pSender, CCControlEvent pCCControlEvent);
	void _onNotification(CCObject* object);
	void changeTab( PackTab tab );
};

#endif